<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <a href="" ></a>
    </div>
  </body>
  <script src="https://unpkg.com/vue@next"></script>
</html>
<script>
  const app = Vue.createApp({
    data() {
      return {
        message: "jspang.com"
      };
    },
    template: `<div><h2>{{message}}</h2>
      <button @click=btfn>按钮</button>
      </div>`,
    methods:{
      btfn(){
        this.message='hehe'
        // console.log(this.message) //此时dom
        console.log(this.$el.textContent)
        this.$nextTick(()=>{
        console.log(this.$el.textContent)

        })
      }
    },
    beforeUnmount() {
      console.log("beforeUnmount");
    },
    beforeDestroy(){
      // console.log(1)
    }
  });
  let vm = app.mount("#app"); //获取根组件
  // console.log(vm);
</script>
